package sklepik;

import java.io.File;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.List;

public class ResultExporterCsvImpl implements ResultExporter {
	/* (non-Javadoc)
	 * @see sklepik.ResultExporter#exportResultRecords(java.util.List)
	 */
	private String start = "name_pl,shortdescription_pl,description_pl,seo_pl,delivelercode,ean,barcode,buyprice,sellprice,stock,weight,photo,vat,producer,category";
	@Override
	public void exportResultRecords(List<ResultRecord> resultRecords){
		
		try { 
			BufferedWriter out = new BufferedWriter(new FileWriter("C:\\Users\\wolak\\silvercsv.csv", true));
			out.append(start);
			for(ResultRecord resultin : resultRecords){
				out.append(resultin.toString());
				}
			out.close();
			} catch (IOException e) { 
			} 
		
		
}
}
